class Student:
    school='学校'

    def __init__(self,name1,id):
        print('------我是init方法 对象初始化工作------')
        self.name=name1
        self.id=id
    def study(self):
        print(f'学生{self.name}学习')
    def exercise(self,newname):
        self.name = newname  # 修改实例属性
        Student.school = "经发学校"
        self.eat()
        print(f"学生{self.name}锻炼")
    def eat(self):
        print(f'学生{self.name}吃饭')
tom = Student('tom',2)
print(tom.school)
tom.study()
# tom.exercise()
tom.eat()
tom.name='汤姆'
print(tom.name)
Student.school='经开'
print(Student.school)
tom.exercise("tomplus")
print("-------------")
print(tom.school)
print(tom.name)
tom.study()
